package cn.t11.dm.user.controller;

import cn.t11.dm.user.service.LocalDmUserService;
import cn.t11.pojo.Dto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

@RestController
public class DmUserController {

    @Autowired
    private LocalDmUserService localDmUserService;

    @PostMapping("/user/api/p/login")
    public Dto<List> doLogin(@NotNull(message = "phone不能为空") String phone,
                            @NotNull(message = "password不能为空") String password)
            throws Exception {
        return localDmUserService.doLogin(phone, password);
    }
}
